package com.onvifdemo.Entity;


import com.onvifdemo.dto.DeviceInfo;
import com.onvifdemo.dto.TestUserPwd;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;

public class Common {

    // 临时存放采集的设备信息
    public static Map<String, DeviceInfo> deviceNtpMap = new ConcurrentHashMap<String, DeviceInfo>();

    // 临时存放采集的设备时间信息
    public static Map<String, DeviceInfo> deviceTimeMap = new ConcurrentHashMap<String, DeviceInfo>();

    /**
     * 测试用户密码
     */
    public static Map<String, TestUserPwd> testPwdMap = new ConcurrentHashMap<String, TestUserPwd>();

    // ntp countDownLantch
    volatile public static CountDownLatch cdlNtp = null;

    // time countDownLantch
    volatile public static CountDownLatch cdlTime = null;

    // testPwd countDownLantch
    volatile public static CountDownLatch testPwd = null;

    volatile public static boolean TIMESYNCSTATUE = true;

    /**
     * 测试用户密码
     */
    volatile public static boolean TESTUSERPWD = true;

    public static synchronized boolean getTestUserPwdState() {
        return TESTUSERPWD;
    }

    public static synchronized void setTestUserPwdState(boolean state) {
        TESTUSERPWD = state;
    }

}
